﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:Core="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions">

	<Style x:Key="PopupButtonStyle" TargetType="ButtonBase">
		<Setter Property="OverridesDefaultStyle" Value="True" />
		<Setter Property="Padding" Value="2" />
		<Setter Property="HorizontalContentAlignment" Value="Center" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="Background" Value="Black" />
		<Setter Property="Foreground" Value="WhiteSmoke" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ButtonBase">
					<Border Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding Foreground}" BorderThickness="1.5">

						<VisualStateManager.CustomVisualStateManager>
							<Core:ExtendedVisualStateManager />
						</VisualStateManager.CustomVisualStateManager>

						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="0:0:0.15">
										<!--<VisualTransition.GeneratedEasingFunction>
											<CubicEase EasingMode="EaseOut" />
										</VisualTransition.GeneratedEasingFunction>-->
									</VisualTransition>
								</VisualStateGroup.Transitions>
								<VisualState x:Name="Normal" />
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<ColorAnimation
												Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"
												To="#606060" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ColorAnimation
												Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"
												To="#707070" />
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="CheckStates">
								<VisualState x:Name="Checked">
									<Storyboard>
										<ColorAnimation Storyboard.TargetName="toggleButtonRect"
												Storyboard.TargetProperty="Fill.(SolidColorBrush.Color)"
												To="#505050" Duration="0:0:0" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Unchecked" />
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

						<Grid>
							<Rectangle x:Name="toggleButtonRect" Fill="Transparent" />
							<ContentPresenter Margin="{TemplateBinding Padding}"
									HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
									VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>